Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

feat: remove openshift/generic-admission-server #1263

Conversation

makkes
Copy link
Contributor

@makkes makkes commented Aug 3, 2020

What this PR does / why we need it:
This PR removes the dependency on the now unmaintained github.com/openshift/generic-admission-server library by migrating the webhook server to sigs.k8s.io/controller-runtime.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
no issue

Special notes for your reviewer:

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 3, 2020
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 3, 2020
@makkes makkes force-pushed the makkes/rip-generic-admission-server branch 4 times, most recently from ac2a764 to c3ddea2 Compare August 3, 2020 22:18
@makkes
Copy link
Contributor Author

makkes commented Aug 4, 2020

This is getting somewhere, at least I got around the flag problem imposed by controller-runtime. Now it's mostly getting ready and health checks done as well as any additional flags that would be needed.

@makkes makkes force-pushed the makkes/rip-generic-admission-server branch 6 times, most recently from ccfff87 to 8cb14a2 Compare August 5, 2020 08:08
@makkes
Copy link
Contributor Author

makkes commented Aug 5, 2020

CI blocked by #1264

@makkes makkes force-pushed the makkes/rip-generic-admission-server branch from 8cb14a2 to 98ff2a1 Compare August 5, 2020 11:11
@makkes
Copy link
Contributor Author

makkes commented Aug 5, 2020

/retest

error from kind

@k8s-ci-robot
Copy link
Contributor

@makkes: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

error from kind

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@makkes makkes marked this pull request as ready for review August 5, 2020 11:32
@makkes makkes changed the title wip: remove openshift/generic-admission-server feat: remove openshift/generic-admission-server Aug 5, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 5, 2020
That library os not actively maintained, anymore, and (worse) blocks
updating k8s dependencies to v0.18 and beyond because of breaking
changes to client-go (context.Context pass to most of the public
functions now).

Therefore, I refactored the webhook to rely on controller-runtime.
This also simplifies much of the webhook's code.
@makkes
Copy link
Contributor Author

makkes commented Aug 5, 2020

/assign @jimmidyson

@jimmidyson
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Aug 5, 2020
@jimmidyson
Copy link
Contributor

/retest

@jimmidyson
Copy link
Contributor

Manually restarted Travis build.

Copy link
Contributor

@jimmidyson jimmidyson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great thank you! Some minor tweaks, but looking forward to getting this in!

@@ -94,7 +92,7 @@ spec:
name: serving-cert
readinessProbe:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a liveness probe too to /healthz?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer not to introduce any additional bigger changes in this PR to have a clear path to track back possible issues that might be caused by these changes. Would you agree on me adding a livenessProbe in a subsequent PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's fine.

cmd/webhook/app/webhook.go Outdated Show resolved Hide resolved
cmd/webhook/app/webhook.go Outdated Show resolved Hide resolved
cmd/webhook/app/webhook.go Outdated Show resolved Hide resolved
if err != nil {
klog.Fatalf("error getting clientset: %s", err)
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a healthz checker here too:

Suggested change
hookServer.WebhookMux.Handle("/helathz/", http.StripPrefix("/healthz", &healthz.Handler{})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above. I'd like to tackle this in a subsequent PR to not dilute this one. 🙂

cmd/webhook/app/webhook.go Outdated Show resolved Hide resolved
cmd/webhook/app/webhook.go Outdated Show resolved Hide resolved
cmd/webhook/main.go Outdated Show resolved Hide resolved
pkg/controller/webhook/util.go Show resolved Hide resolved
pkg/controller/webhook/kubefedconfig/webhook.go Outdated Show resolved Hide resolved
* clean up imports
* use port 8443 by default for webhook, get rid of a constant
* remove dead code
* remove unnecessary Ping handler
@makkes makkes force-pushed the makkes/rip-generic-admission-server branch from 98ff2a1 to 66a2e42 Compare August 5, 2020 17:39
@makkes
Copy link
Contributor Author

makkes commented Aug 5, 2020

@jimmidyson sorry for the force-push, I rebased. Your comments have been addressed in 66a2e42.

@makkes makkes requested a review from jimmidyson August 5, 2020 17:40
@jimmidyson
Copy link
Contributor

Thanks @makkes - love this PR!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 5, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jimmidyson, makkes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 5, 2020
@k8s-ci-robot k8s-ci-robot merged commit ab53876 into kubernetes-retired:master Aug 5, 2020
@makkes makkes deleted the makkes/rip-generic-admission-server branch August 6, 2020 08:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants